<?php

namespace App\Listeners;

use App\Events\userevent;
use App\libs\Db2;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;


class usereventlistener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     * 登陆成功之后分配用户变量
     * @param  userevent  $event
     * @return void
     */
    public function handle(userevent $event)
    {
        //$rid = Session::get("rid");
        $rid = $event->rid;
        return $rid?(DB::table("register")->where("id", $rid)->first()):null;

    }
}
